#!/usr/bin/env python
#this is a proxy node of nidaqIO node to avoid frequent connect/disconnect
#to interrupt realtime behavoir of the actual nidaqIONode that touches hardware
import roslib; roslib.load_manifest('nidaqIO');
import rospy
from nidaqIO.msg import Doubles

rospy.init_node("nidaqIOProxy");
pubwrite=rospy.Publisher("diego/writeraw", Doubles);
def cbwrite(data):
	pubwrite.publish(data)
	

subwrite=rospy.Subscriber("diego/writeraw2", Doubles, cbwrite, tcp_nodelay=True);


pubread=rospy.Publisher("diego/readraw2", Doubles);
def cbread(data):
	pubread.publish(data)
subread=rospy.Subscriber("diego/readraw", Doubles, cbread, tcp_nodelay=True);

rospy.spin()
